package com.zhy.springmvc.controller;

import com.zhy.springmvc.entity.Task;
import com.zhy.springmvc.service.impl.TaskServiceImpl;
import com.zhy.springmvc.service.intf.TaskService;
import com.zhy.springmvc.vo.PageBean;
import com.zhy.springmvc.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class TaskController {
    @Autowired
    private TaskService service;
    @RequestMapping("/api/insert/zhy.do")
    @ResponseBody
    public R insert(Task task){
        return service.insert(task);
    }

    @RequestMapping("/api/selectAll/zhy.do")
    @ResponseBody
    public PageBean selectAll(){
        return service.selectAll();
    }

    @RequestMapping("/api/selectTaskName/zhy.do")
    @ResponseBody
    public PageBean selectTaskName(String taskname){
        return service.selectTaskName(taskname);
    }

    @RequestMapping("/api/selecttake/zhy.do")
    @ResponseBody
    public R selecttake(Integer flag){

        return service.selecttask(flag);
    }


}
